package com.zhuoyue.biz.core.api.dao;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhuoyue.biz.core.api.domain.RoomDO;
import com.zhuoyue.biz.core.api.domain.room.GetRoomAndDeviceCountDO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author wjming
 * @ClassName: RoomDao
 * @Description: 房间数据层
 * @Date 2021-07-02 10:30
 */
public interface RoomDao extends BaseMapper<RoomDO> {

    /**
     * 选择性修改房间
     *
     * @param room
     * @return
     */
    public int updateRoomSelective(RoomDO room);


    /**
     * 根据主键查询房间信息
     *
     * @param homeId
     * @return
     */
    List<GetRoomAndDeviceCountDO> selectRoomAndDeviceCountByRoomId(@Param("homeId") String homeId);

    /**
     * 查询设备数量通过房间ID
     *
     * @param roomId
     * @return
     */
    int selectDeviceCountByRoomId(@Param("roomId") String roomId);

}
